CONTENTS | INDEX | PREV | NEXT
 FUNCTION
 Generate Motorola S-Records

 SYNOPSIS
 bintohex inFile [-o outFile] -s[1,2,3] [-i] [-O offset]

 DESCRIPTION
 Bintohex converts a binary file into Motorola S-Record or Intel  Hex
 format files.  Hex format files are used by many brands of EPROM or
 Flash EPROM programming devices, and are accepted by by most vendors
 of mask ROM.

 inFile  Binary input file.

 -o outFile
     Output file.  If no output file is specified, bintohex writes to
     the console.

 -s[1,2,3]  Specify Motorola S-Record format.  Records are output in the
     form:

     SXnn[addr]DD..DDcc

    SX     : X is the file type, S1, S2 or S3.
    -------+-------------------------------------------------------
    nn     : Number of bytes, not including the two nn characters.
    -------+-------------------------------------------------------
    [addr] : Address.  S1=4 bytes, 64K limit.
    -------+-------------------------------------------------------
           : S2=6 bytes, 16MB limit.
    -------+-------------------------------------------------------
           : S3=8 bytes, 4GB limit.
    -------+-------------------------------------------------------
    DD..DD : Data, in hexadecimal pairs.
    -------+-------------------------------------------------------
    cc     : Line checksum. 0xff minus the sum of bytes on line.
    -------+-------------------------------------------------------

 -i  Specify Intel Hex format.  64K bytes maximum.  Records are
     formatted:

     :xxaaaarrDD..DDcc

 xx   : Number of bytes on line.
 -----+--------------------------------------------------------------
 aaaa : Address. Intel files are limited to 64K bytes of addressing.
 -----+--------------------------------------------------------------
 rr   : Record type: 00=normal, 01=end.
 -----+--------------------------------------------------------------
 DD   : Data (xx bytes worth).
 -----+--------------------------------------------------------------
 cc   : Checksum: 0 minus the sum of bytes on line.
 -----+--------------------------------------------------------------

 -O offset  Set initial address offset for hex file.